<template>
  <view class="license-wrap">
    <!-- #ifdef H5 -->
    <van-nav-bar @click-left="onClickLeft" left-arrow title="营业执照"></van-nav-bar>
    <!-- #endif -->
    <view class="license-wrap-cnt">
      <image class="img" mode="widthFix" :src="url"></image>
      <view class="title">
        <icon class="iconfont icon-tixing"></icon>
        <text class="text">温馨提示</text>
      </view>
      <view class="detail">以上证照信息来源于经营者自行申报数据，具体以工商部门登记为准。</view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { setToastInstance, systemInfo } from '@/mixins/info';
// #ifdef MP-WEIXIN
import { useToast } from '@/components/wxToast';
setToastInstance(useToast());
// #endif

const url = ref('');
onLoad((option: any) => {
  // console.log('bb----------', option, decodeURIComponent(option.url));
  url.value = `${decodeURIComponent(option.url)}` || '';
});
// #ifdef H5
const onClickLeft = () => {
  uni.navigateBack();
};
setTimeout(() => {
  const navBarEle = document.querySelector('.van-nav-bar') as HTMLElement;
  navBarEle.style.paddingTop = `${systemInfo.statusBarHeight}px`;
});
// #endif
</script>

<style lang="scss" scoped>
.license-wrap {
  box-sizing: border-box;
  width: 100%;
  &-cnt {
    box-sizing: border-box;
    padding: 16px;
  }
  .img {
    width: 100%;
  }
  // .img::before {
  //   content: '仅供小程序使用';
  //   position: absolute;
  //   top: 50%;
  //   left: 50%;
  //   transform: translate(-50%, -50%);
  //   font-size: 24px;
  //   opacity: 0.5;
  // }
  .title {
    .icon-tixing {
      font-size: 16px;
      color: #fa3939;
    }
    .text {
      font-size: 16px;
      color: #fa3939;
    }
  }
  .detail {
    font-size: 14px;
    color: #545454;
    line-height: 24px;
    margin-top: 8px;
  }
}
</style>